package com.yuyou.tas.lesson.annotation;

import java.util.HashMap;
import java.util.Map;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;

@Aspect 
@Component 
public class OrganLimitAspect {
	
	@Pointcut("@annotation(com.yuyou.tas.lesson.annotation.OrganLimit)")
    public  void annotationPointCut() {
    }

    @Before("annotationPointCut()")
    public void before(JoinPoint joinPoint) throws Exception{  	     	
       MethodSignature sign =  (MethodSignature)joinPoint.getSignature();     
       String[] param=sign.getParameterNames();
       Object[] value = joinPoint.getArgs();      
       Map<String,Object> paramMap=new HashMap<String,Object>();     
       for(int i=0;i<param.length;i++){
    	   paramMap.put(param[i], value[i]);
       }
    }
	

    
    
}
